<%@ page import="restfuljobs.JobApplicationReview" %>



<div class="fieldcontain ${hasErrors(bean: jobApplicationReviewInstance, field: 'application', 'error')} required">
	<span id="application-label" class="property-label"><g:message code="jobApplicationReview.application.label" default="Application" /></span>
	<span class="property-value" aria-labelledby="application-label"><g:link controller="jobApplication" action="show" id="${jobApplicationReviewInstance?.application?.id}">${jobApplicationReviewInstance?.application?.encodeAsHTML()}</g:link></span>
	<g:hiddenField name="application.id" value="${jobApplicationReviewInstance.application?.id}" />
</div>

<g:if test="${session.user && session.user.type == restfuljobs.User.Type.REVIEWER}">
<div class="fieldcontain ${hasErrors(bean: jobApplicationReviewInstance, field: 'approved', 'error')} ">
	<label for="approved">
		<g:message code="jobApplicationReview.approved.label" default="Approved" />
		
	</label>
	<g:checkBox name="approved" value="${jobApplicationReviewInstance?.approved}" />
</div>

<div class="fieldcontain ${hasErrors(bean: jobApplicationReviewInstance, field: 'comments', 'error')} ">
	<label for="comments">
		<g:message code="jobApplicationReview.comments.label" default="Comments" />
		
	</label>
	<g:textArea name="comments" value="${jobApplicationReviewInstance?.comments}"/>
</div>
</g:if>
<g:elseif test="${!jobApplicationReviewInstance.id}">
	<g:hiddenField name="comments" value="" />
	<g:hiddenField name="approved" value="false" />
</g:elseif>

<g:if test="${session.user && session.user.type == restfuljobs.User.Type.RECRUITER}">

<div class="fieldcontain ${hasErrors(bean: jobApplicationReviewInstance, field: 'reviewer', 'error')} required">
	<label for="reviewer">
		<g:message code="jobApplicationReview.reviewer.label" default="Reviewer" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="reviewer" name="reviewer.id" from="${userList}" optionKey="id" required="" value="${jobApplicationReviewInstance?.reviewer?.id}" class="many-to-one"/>
</div>
</g:if>	
<g:else>	
	<g:hiddenField name="reviewer.id" value="${jobApplicationReviewInstance.reviewer?.id}" />
</g:else>
